#!objective scoretp_x

scoreboard players operation #scoretp__distance scoretp_x = @s scoretp_x

# Negative direction

execute if score #scoretp__distance scoretp_x matches ..-16777216 at @s run tp @s ~-16777216 ~ ~
execute if score #scoretp__distance scoretp_x matches ..-16777216 run scoreboard players add #scoretp__distance scoretp_x 16777216

execute if score #scoretp__distance scoretp_x matches ..-8388608 at @s run tp @s ~-8388608 ~ ~
execute if score #scoretp__distance scoretp_x matches ..-8388608 run scoreboard players add #scoretp__distance scoretp_x 8388608

execute if score #scoretp__distance scoretp_x matches ..-4194304 at @s run tp @s ~-4194304 ~ ~
execute if score #scoretp__distance scoretp_x matches ..-4194304 run scoreboard players add #scoretp__distance scoretp_x 4194304

execute if score #scoretp__distance scoretp_x matches ..-2097152 at @s run tp @s ~-2097152 ~ ~
execute if score #scoretp__distance scoretp_x matches ..-2097152 run scoreboard players add #scoretp__distance scoretp_x 2097152

execute if score #scoretp__distance scoretp_x matches ..-1048576 at @s run tp @s ~-1048576 ~ ~
execute if score #scoretp__distance scoretp_x matches ..-1048576 run scoreboard players add #scoretp__distance scoretp_x 1048576

execute if score #scoretp__distance scoretp_x matches ..-524288 at @s run tp @s ~-524288 ~ ~
execute if score #scoretp__distance scoretp_x matches ..-524288 run scoreboard players add #scoretp__distance scoretp_x 524288

execute if score #scoretp__distance scoretp_x matches ..-262144 at @s run tp @s ~-262144 ~ ~
execute if score #scoretp__distance scoretp_x matches ..-262144 run scoreboard players add #scoretp__distance scoretp_x 262144

execute if score #scoretp__distance scoretp_x matches ..-131072 at @s run tp @s ~-131072 ~ ~
execute if score #scoretp__distance scoretp_x matches ..-131072 run scoreboard players add #scoretp__distance scoretp_x 131072

execute if score #scoretp__distance scoretp_x matches ..-65536 at @s run tp @s ~-65536 ~ ~
execute if score #scoretp__distance scoretp_x matches ..-65536 run scoreboard players add #scoretp__distance scoretp_x 65536

execute if score #scoretp__distance scoretp_x matches ..-32768 at @s run tp @s ~-32768 ~ ~
execute if score #scoretp__distance scoretp_x matches ..-32768 run scoreboard players add #scoretp__distance scoretp_x 32768

execute if score #scoretp__distance scoretp_x matches ..-16384 at @s run tp @s ~-16384 ~ ~
execute if score #scoretp__distance scoretp_x matches ..-16384 run scoreboard players add #scoretp__distance scoretp_x 16384

execute if score #scoretp__distance scoretp_x matches ..-8192 at @s run tp @s ~-8192 ~ ~
execute if score #scoretp__distance scoretp_x matches ..-8192 run scoreboard players add #scoretp__distance scoretp_x 8192

execute if score #scoretp__distance scoretp_x matches ..-4096 at @s run tp @s ~-4096 ~ ~
execute if score #scoretp__distance scoretp_x matches ..-4096 run scoreboard players add #scoretp__distance scoretp_x 4096

execute if score #scoretp__distance scoretp_x matches ..-2048 at @s run tp @s ~-2048 ~ ~
execute if score #scoretp__distance scoretp_x matches ..-2048 run scoreboard players add #scoretp__distance scoretp_x 2048

execute if score #scoretp__distance scoretp_x matches ..-1024 at @s run tp @s ~-1024 ~ ~
execute if score #scoretp__distance scoretp_x matches ..-1024 run scoreboard players add #scoretp__distance scoretp_x 1024

execute if score #scoretp__distance scoretp_x matches ..-512 at @s run tp @s ~-512 ~ ~
execute if score #scoretp__distance scoretp_x matches ..-512 run scoreboard players add #scoretp__distance scoretp_x 512

execute if score #scoretp__distance scoretp_x matches ..-256 at @s run tp @s ~-256 ~ ~
execute if score #scoretp__distance scoretp_x matches ..-256 run scoreboard players add #scoretp__distance scoretp_x 256

execute if score #scoretp__distance scoretp_x matches ..-128 at @s run tp @s ~-128 ~ ~
execute if score #scoretp__distance scoretp_x matches ..-128 run scoreboard players add #scoretp__distance scoretp_x 128

execute if score #scoretp__distance scoretp_x matches ..-64 at @s run tp @s ~-64 ~ ~
execute if score #scoretp__distance scoretp_x matches ..-64 run scoreboard players add #scoretp__distance scoretp_x 64

execute if score #scoretp__distance scoretp_x matches ..-32 at @s run tp @s ~-32 ~ ~
execute if score #scoretp__distance scoretp_x matches ..-32 run scoreboard players add #scoretp__distance scoretp_x 32

execute if score #scoretp__distance scoretp_x matches ..-16 at @s run tp @s ~-16 ~ ~
execute if score #scoretp__distance scoretp_x matches ..-16 run scoreboard players add #scoretp__distance scoretp_x 16

execute if score #scoretp__distance scoretp_x matches ..-8 at @s run tp @s ~-8 ~ ~
execute if score #scoretp__distance scoretp_x matches ..-8 run scoreboard players add #scoretp__distance scoretp_x 8

execute if score #scoretp__distance scoretp_x matches ..-4 at @s run tp @s ~-4 ~ ~
execute if score #scoretp__distance scoretp_x matches ..-4 run scoreboard players add #scoretp__distance scoretp_x 4

execute if score #scoretp__distance scoretp_x matches ..-2 at @s run tp @s ~-2 ~ ~
execute if score #scoretp__distance scoretp_x matches ..-2 run scoreboard players add #scoretp__distance scoretp_x 2

execute if score #scoretp__distance scoretp_x matches ..-1 at @s run tp @s ~-1 ~ ~
